package com.sos.ui 
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	/**
	 * ...
	 * @author Francesco Forte
	 */
	public class FloatingText extends MovieClip 
	{
		
		// -------------------------------------------------------------------------------
		// CONSTANTS
		// -------------------------------------------------------------------------------
		
		protected static const 		POSITIVE_MOD_COLOR:uint		= 0x0FA354;
		protected static const 		NEGATIVE_MOD_COLOR:uint		= 0xF21D39;
		protected static const 		BASE_STAT_COLOR:uint		= 0x000000;
		
		// -------------------------------------------------------------------------------
		// FIELDS
		// -------------------------------------------------------------------------------
		
		private var _textField:TextField;
		private var _color:uint;
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		public function FloatingText(value:int, color:uint) 
		{
			var format:TextFormat = new TextFormat();
			format.size = 16;
			format.bold = true;
			format.align = TextFormatAlign.CENTER;
			
			_textField = new TextField();
			_textField.defaultTextFormat = format;
			_textField.width = 20;
			_textField.height = 20;
			
			if (value > 0)
				_textField.text = "+" + value.toString();
			else
				_textField.text = value.toString();
			_textField.textColor = color;
			addChild(_textField);
		}
		
		// -------------------------------------------------------------------------------
		// PUBLIC METHODS
		// -------------------------------------------------------------------------------
		
		
		
	}

}